/**
 * @domain JQuery
 * @param {Object} 'div.whole'
 * @auther Danial
 */
$(document).ready(function(){
    //	fixPng();
    //    $('div.whole').hide().fadeIn(2000);
    //    $(window).resize(function(){
    //        $('group').css({
    //            "position": ""
    //        });
    //		$('group').css({
    //            "position": "relative"
    //        });
    //    });
    var isAnimateFinish = true;
	 var image = document.getElementById("reflex");
            cvi_reflex.add(image, {
                height: 30,
                distance: 20,
                border: 0,
                tilt: 'right'
            });
			$('#reflex').removeAttr('id');
    $('li.button').hover(function(){
        //		this.css("background-image","url(image/bt_on_80x30.jpg)");
        $(this).css({
            "background-image": "url(image/bt_on_80x30.jpg)"
        });
        $(this).children().css({
            "color": "white"
        });
    }, function(){
        $(this).css({
            "background-image": ""
        });
        $(this).children().css({
            "color": ""
        });
    });
    $('li.button').mousedown(function(){
        $(this).css({
            "background-image": "url(image/bt_down_80x30.jpg)"
        });
    });
    $('li.button').mouseup(function(){
        $(this).css({
            "background-image": "url(image/bt_on_80x30.jpg)"
        });
    });
    $('div.evertop').hover(function(){
        if (isAnimateFinish) {
            isAnimateFinish = false;
            $('div.evertop').animate({
                bottom: 0
            }, 'fast', function(){
                isAnimateFinish = true;
            });
        }
        
    }, function(){
        if (isAnimateFinish) {
            isAnimateFinish = false;
            $('div.evertop').animate({
                bottom: -60
            }, 'fast', function(){
                isAnimateFinish = true;
            });
        }
    });
    $('#11').click(function(){
        alert('Image dimension ' + this.width + 'x' + this.height);
    });
});
var excutetimes = 0;
var animatefinished=2;
var ps = 0;
function nextPic(){
	if (animatefinished>=2) {
		animatefinished=0;
		 excutetimes = 0;
    var cover = $('.rightvotepanel').children().animate({
        top: -120
    }, 'slow', function(){
    
        cover.eq(0).appendTo($('.rightvotepanel'));
        $('.rightvotepanel').children().css({
            'top': '0'
        });
        if (excutetimes == 0) {
            var clone = cover.eq(3).clone();
            clone.removeClass('small_pic_panel').addClass('big_pic_panel').children(".smallimg").removeClass('smallimg').addClass('bigimg').find("td").empty().append('<IMG id="reflex"  src="'+clone.attr('src')+'"/>');
            clone.appendTo($('.leftvotepanel'));
            var image = document.getElementById("reflex");
            cvi_reflex.add(image, {
                height: 30,
                distance: 20,
                border: 0,
                tilt: 'right'
            });
			$('#reflex').removeAttr('id');
            excutetimes = 1;
			animatefinished++;
        }
    });
    var bigcover = $('.leftvotepanel').children().animate({
        top: -360
    }, 'slow', function(){
        bigcover.eq(0).remove();
        $('.leftvotepanel').children().css({
            'top': '0'
        });
		animatefinished++;
    });
	}
//    $('.leftvotepanel').children().eq(0)
//    var image = document.getElementById("reflex");
//    cvi_reflex.add(image, {
//        height: 30,
//        distance: 20,
//        border: 0,
//        tilt: 'right'
//    });
}


